package com.cyl.wms.path;

public class DijkstraTest {
    public static void main(String[] args) {
        int[][] graph = {
                {0, 10, 0, 30, 100},
                {10, 0, 50, 0, 0},
                {0, 50, 0, 20, 10},
                {30, 0, 20, 0, 60},
                {100, 0, 10, 60, 0}
        };
        int start = 0;

        DijkstraAlgorithm dijkstra = new DijkstraAlgorithm(graph, start);
        dijkstra.run();
        int[] shortestDistances = dijkstra.getShortestDistances();

        System.out.println("Shortest distances from node " + start + " to all other nodes:");
        for (int i = 0; i < shortestDistances.length; i++) {
            System.out.println("Node " + i + ": " + shortestDistances[i]);
        }
    }
}
